package me.xue.communityhealth.model;

import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

/**
 * 药品
 */
@Getter
@Setter
public class Drug implements Serializable {

    private Integer id;

    private String num;

    @NotBlank(message = "药品名称不能为空")
    private String name;

    private String abbreviate;

    @Min(value = 0, message = "费用不能小于0")
    private Float cost;

    //药品单位
    private String drugUnit;
    //药库
    private String drugDepot;
    //产地
    private String drugPlace;
    //供应商
    private String drugSupplier;
    //药品类型
    private String drugType;

    //药品描述
    private String description;

    //生产日期
    @NotNull
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date produceDate;

    //入库时间
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date storageTime;

    //采购人员
    @NotBlank(message = "采购人员不能为空")
    private String who;

    //图片
    private String photo;
}
